#include <asm/io.h>
#include "fmtprint.h"
#include "debug.h"

/// write character to local printer port.
int kdebugc_lpt(unsigned c, void** ptr )
{
	outb(c, LPT_PORT);
	outb(0x0c, LPT_PORT + 0x2);
	outb(0x0d, LPT_PORT + 0x2);
	return 0;
}

/// handle formatted kernel debug message.
void kdebugf(const char *fmt, ...)
{
	va_list args;

	va_start(args, fmt);
	do_printf(fmt, args, &kdebugc_lpt, 0);
	va_end(args);
	return;
}

/// empty function that the optimizer will hopefully optimize all calls away when debugging if off.
void kdebugf_null(const char *fmt, ...)
{
	return;
}
